<?php /* Smarty version 2.6.26, created on 2013-10-24 20:23:16
         compiled from ./admin/category_info.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "../templates/admin/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script type="text/javascript" src="../js/jquery.js">
</script>
<script type="text/javascript" src="js/category.js">
</script>

<div class="main-div">
  <form action="category.php<?php if ($this->_tpl_vars['action'] != ''): ?>?act=<?php echo $this->_tpl_vars['action']; ?>
<?php else: ?>?act=''<?php endif; ?>" method="post" name="theForm" enctype="multipart/form-data">
  <table width="100%" id="general-table">
  <?php if ($this->_tpl_vars['judge'] == 'add'): ?>
      <tr>
        <td class="label">添加分类:</td>
        <td>
          <input type='text' name='cat_name' maxlength="20" value='' size='27' /> <font color="red">*</font>
        </td>
      </tr>
      <tr>
        <td class="label">上级分类:</td>
        <td>
          <select name="parent_id">
                        <option value="0" selected="selected" >请选择...</option>
                        <?php $_from = $this->_tpl_vars['category_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
                        <option value="<?php echo $this->_tpl_vars['list']['cat_id']; ?>
" ><?php echo $this->_tpl_vars['list']['cat_name']; ?>
</option>
                        <?php endforeach; endif; unset($_from); ?>
		  </select>
        </td>
      </tr>
      
      <tr id="measure_unit">
        <td class="label">数量单位:</td>
        <td>
          <input type="text" name='measure_unit' size="12" />
        </td>
      </tr>

      <tr>
        <td class="label">是否显示:</td>
        <td>
          <input type="radio" name="is_show" value="1" checked="true"/> 是
          <input type="radio" name="is_show" value="0" /> 否
        </td>
      </tr>
      
    
		<tr>
			<td class="label">筛选属性:</td>
			<td>
				<table width="100%" id="tbody-attr" align="center">
					<?php if ($this->_tpl_vars['attr_cat_id'] == 0): ?>
					<tr>
						<td>   
						<a href="javascript:;" onclick="addFilterAttr(this)">[+]</a> 
						<select class="select1" onChange="changeCat(this)" >
						<option value="0" selected="selected">请选择商品类型</option>
						<?php $_from = $this->_tpl_vars['cat_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['cat']):
?>
						<option class="attr" value="<?php echo $this->_tpl_vars['cat']['cat_id']; ?>
"><?php echo $this->_tpl_vars['cat']['cat_name']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
						</select>&nbsp;&nbsp;
						<select name="filter_attr">
						<option value="3" selected="selected">请选择筛选属性</option>
						</select><br />                   
						</td>
					</tr> 
					<?php endif; ?>           
					<!-- <tr>
						<td>
						<a href="javascript:;" onclick="removeFilterAttr(this)">[-]&nbsp;</a>
						<select onChange="changeCat(this)">
						<option value="0">请选择商品类型</option>
						</select>&nbsp;&nbsp;
						<select name="filter_attr"><option value="0">请选择筛选属性</option></select><br />
						</td>
					</tr> -->
				</table>
			</td>
		</tr>
				
		<tr>
        	<td class="label">价格区间个数：</td>
        	<td>
       		<input type="text" name="grade" value="0" size="40" /> <br />
       		<span class="notice-span">该选项表示该分类下商品最低价与最高价之间的划分的等级个数，填0表示不做分级。</span>
        	</td>
      	</tr>    
	</table>
	

      <div class="button-div">
        <input type="submit" value="确定" />
        <input type="reset" value="重置" />
      </div>
    <input type="hidden" name="act" value="{$form_act}" />
    <input type="hidden" name="old_cat_name" value="{$cat_info.cat_name}" />
    <input type="hidden" name="cat_id" value="{$cat_info.cat_id}" />
  </form>
</div>

      
  <?php endif; ?>
  <?php if ($this->_tpl_vars['judge'] == 'edit'): ?>
  <tr>
        <td class="label">分类名称:</td>
        <td>
          <input type='text' name='cat_name' maxlength="20" value='<?php echo $this->_tpl_vars['cat']['cat_name']; ?>
' size='27' /> <font color="red">*</font>
        </td>
      </tr>

      <tr>
        <td class="label">是否显示:</td>
        <td>
          <input type="radio" name="is_show" value="1" <?php if ($this->_tpl_vars['cat']['is_show'] == 1): ?> checked="true"<?php endif; ?> /> 是
          <input type="radio" name="is_show" value="0" <?php if ($this->_tpl_vars['cat']['is_show'] == 0): ?> checked="true"<?php endif; ?> /> 否
        </td>
      </tr> 
      <input type="hidden" name="cat_id" value="<?php echo $this->_tpl_vars['cat']['cat_id']; ?>
" />
      <input type="hidden" name="parent_id" value="<?php echo $this->_tpl_vars['cat']['parent_id']; ?>
" />
  	</table>
      <div class="button-div">
        <input type="submit" value="确定" />
        <input type="reset" value="重置" />
      </div>
  <?php endif; ?>
  <?php if ($this->_tpl_vars['judge'] == 'move'): ?>
  <tr>
    <td colspan="2" align="center">
      <strong>从此分类</strong>&nbsp;&nbsp;
      <select name="cat_id">
       <option value="0">请选择...</option>
       <?php $_from = $this->_tpl_vars['cat_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
       <option value="<?php if ($this->_tpl_vars['list']['cat_id'] == $this->_tpl_vars['row']['cat_id']): ?><?php echo $this->_tpl_vars['list']['cat_id']; ?>
" selected="selected"<?php else: ?><?php echo $this->_tpl_vars['list']['cat_id']; ?>
<?php endif; ?>"><?php if ($this->_tpl_vars['list']['lev'] == 2): ?>&nbsp;&nbsp;<?php endif; ?><?php if ($this->_tpl_vars['list']['lev'] == 3): ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php endif; ?><?php echo $this->_tpl_vars['list']['cat_name']; ?>
</option>
       <?php endforeach; endif; unset($_from); ?>
      </select>&nbsp;&nbsp;
      <strong>转移到</strong>
      <select name="target_cat_id">
       <option value="0">请选择...</option>
       <?php $_from = $this->_tpl_vars['cat_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
       <option value="<?php if ($this->_tpl_vars['list']['cat_id'] == $this->_tpl_vars['row']['cat_id']): ?><?php echo $this->_tpl_vars['list']['cat_id']; ?>
" selected="selected"<?php else: ?><?php echo $this->_tpl_vars['list']['cat_id']; ?>
<?php endif; ?>"><?php if ($this->_tpl_vars['list']['lev'] == 2): ?>&nbsp;&nbsp;<?php endif; ?><?php if ($this->_tpl_vars['list']['lev'] == 3): ?>&nbsp;&nbsp;&nbsp;&nbsp;<?php endif; ?><?php echo $this->_tpl_vars['list']['cat_name']; ?>
</option>
       <?php endforeach; endif; unset($_from); ?>
      </select>&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="submit" name="move_cat" value="开始转移" class="button">
      <input type="reset" value="重置" class="button" />
    </td>
  </tr>
  </table>
  <?php endif; ?>
  </form>
</div>


</body>
</html>